<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>店铺设置-用户中心</title>
<meta name="keywords"  content="DeathGhost" />
<meta name="description" content="DeathGhost" />
<meta name="author" content="DeathGhost,deathghost@deathghost.cn">
<link rel="icon" href="images/icon/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/style.css" /><script src="js/html5.js"></script>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function(){
  $("nav .indexAsideNav").hide();
  $("nav .category").mouseover(function(){
	  $(".asideNav").slideDown();
	  });
  $("nav .asideNav").mouseleave(function(){
	  $(".asideNav").slideUp();
	  });
});
</script>
</head>
<body>
<!--header-->
<div id="app">
<header>
  <!--topNavBg-->
  <div class="topNavBg">
   <div class="wrap">
   <!--topLeftNav-->
    <ul class="topLtNav">
     <li><a href="login.html" class="obviousText">亲，请登录</a></li>
     <li><a href="register.html">注册</a></li>
     <li><a href="#">移动端</a></li>
    </ul>
   <!--topRightNav-->
    <ul class="topRtNav">
     <li><a href="user.html">个人中心</a></li>
     <li><a href="cart.html" class="cartIcon">购物车<i>0</i></a></li>
     <li><a href="favorite.html" class="favorIcon">收藏夹</a></li>
     <li><a href="user.html">商家中心</a></li>
     <li><a href="article_read.html" class="srvIcon">客户服务</a></li>
     <li><a href="union_login.html">联盟管理</a></li>
    </ul>
   </div>
  </div>
  <!--logoArea-->
  <div class="wrap logoSearch">
   <!--logo-->
   <div class="logo">
    <h1><img src="images/idid_ifrtgzddgm3dmnjshezdambqhayde_49x48.png"/></h1>
   </div>
   <!--search-->
   <div class="search">
    <ul class="switchNav">
     <li class="active" id="chanpin">产品</li>
     <li id="shangjia">商家</li>
     <li id="zixun">搭配</li>
     <li id="wenku">文库</li>
    </ul>
    <div class="searchBox">
     <form>
      <div class="inputWrap">
      <input type="text" placeholder="输入产品关键词或货号"/>
      </div>
      <div class="btnWrap">
      <input type="submit" value="搜索"/>
      </div>
     </form>
     <a href="#" class="advancedSearch">高级搜索</a>
    </div>
   </div>
  </div>
  <!--nav-->
  <nav>
<ul class="wrap navList">
<li class="category">
<a>全部产品分类</a>
</li>
<li>
<a href="index.html" class="active">首页</a>
</li>
<li>
<a href="#">时尚搭配</a>
</li>
<li>
<a href="channel.html">原创设计</a>
</li>
<li>
<a href="channel.html">时尚代购</a>
</li>
<li>
<a href="channel.html">民族风</a>
</li>
<li>
<a href="information.html">时尚搭配</a>
</li>
<li>
<a href="library.html">搭配知识</a>
</li>
<li>
<a href="#">促销专区</a>
</li>
<li>
<a href="#">其他</a>
</li>
</ul>
</nav>

 </header>

 
<section class="wrap user_center_wrap">
 <!--左侧导航-->
  <aside class="user_aside_nav">
  <!-- <dl>
   <dt>买家中心</dt>
   <dd><a href="order_list.html">我的订单</a></dd>
   <dd><a href="price_list.html">我的询价单</a></dd>
   <dd><a href="favorite.html">我的收藏</a></dd>
   <dd><a href="address.html">我的地址库</a></dd>
  </dl> -->
  <dl>
   <dt>商家管理中心</dt>
   <dd><a href="authenticate.html">我要开店</a></dd>
   <dd><a href="setting.html">店铺设置</a></dd>
   <dd><a href="seller_product_list.html">商品列表</a></dd>
   <dd><a href="seller_order_list.html">订单列表</a></dd>
   <dd><a href="javascript:void(0)">询价单</a></dd>
  </dl>
  <!-- <dl>
   <dt>控制面板</dt>
   <dd><a href="message.html">站内短消息</a></dd>
   <dd><a href="account.html">资金管理</a></dd>
   <dd><a href="profile.html">个人资料</a></dd>
   <dd><a href="change_password.html">修改密码</a></dd>
  </dl> -->
 </aside>
 <!--右侧：内容区域-->
 <div class="user_rt_cont">
  <div class="top_title">
   <strong>店铺设置</strong>
  </div>
  <table class="order_table">
   <tr>
    <td width="80" align="right">店铺名称：</td>
    <td>
    <input type="text" class="textbox textbox_225" v-model="shopname"/>
    <mark class="tips_errors">这里是提示性或错误信息</mark>
    </td>
   </tr>
   <tr>
    <td width="80" align="right">店铺logo：</td>
    <td>
      <label class="uploadImg">
      <input type="file" style="display:none;" @change="upload" onchange="setImagePreviews(this, 'showpic')" id="photo" name="photo"/>
       <span v-if="pics">上传图片</span>
       <img :src="list[0]" v-else  >
      </label>
      <mark class="tips_errors">这里是提示性信息</mark>
    </td>
   </tr>
   <tr>
    <td width="80" align="right">营业时间：</td>
    <td>
    <input type="text" class="textbox textbox_225" v-model="time"/>
    <mark class="tips_errors">这里是提示性或错误信息</mark>
    </td>
   </tr>
   <tr>
    <td width="80" align="right">联系方式：</td>
    <td>
    <input type="text" class="textbox textbox_225" v-model="tel"/>
    <mark class="tips_errors">这里是提示性或错误信息</mark>
    </td>
   </tr>
   <tr>
    <td width="80" align="right">关于我们：</td>
    <td>
    <textarea placeholder="内容" class="textarea" style="width:500px;height:100px;" v-model="text" ></textarea>
    </td>
   </tr>
   <tr>
    <td width="80" align="right"></td>
    <td>
    <input type="button" value="更新保存" class="group_btn" @click="uptext"/>
    </td>
   </tr>
  </table>
 </div>
</section>
<!--footer-->
<footer>
 <!--help-->
 <ul class="wrap help">
  <li>
   <dl>
    <dt>消费者保障</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>新手上路</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>付款方式</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>服务保障</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
 </ul>
 <dl class="wrap otherLink">
  <dt>友情链接</dt>
  <dd><a href="http://www.htmlsucai.com" target="_blank">17素材</a></dd>
  <dd><a href="http://www.htmlsucai.com/pins/24448.html">HTML5模块化后台管理模板</a></dd>
  <dd><a href="http://www.htmlsucai.com/pins/15966.html">绿色清爽后台管理系统模板</a></dd>
  <dd><a href="http://www.htmlsucai.com/pins/14931.html">黑色的cms商城网站后台管理模板</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">前端博客</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">博客</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">新码笔记</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">DethGhost</a></dd>
  <dd><a href="#">当当</a></dd>
  <dd><a href="#">优酷</a></dd>
  <dd><a href="#">土豆</a></dd>
  <dd><a href="#">新浪</a></dd>
  <dd><a href="#">钉钉</a></dd>
  <dd><a href="#">支付宝</a></dd>
 </dl>
 <div class="wrap btmInfor">
  <p>(c) 2013 DeathGhost.cn 版权所有 网络文化经营许可证：浙网文[2013]***-027号 增值电信业务经营许可证：浙B2-200***24-1 信息网络传播视听节目许可证：1109***4号</p>
  <address>联系地址：陕西省西安市雁塔区XXX号</address>
 </div>
</footer></div>
<script src="js/jquery.js"></script>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script type="text/javascript" src="js/show-dialog.js"></script>
<script type="text/javascript" src="js/qs.js"></script>
<script src="back/js/ajaxfileupload.js" charset="utf-8"></script>
<script src="back/js/showpic.js" charset="utf-8"></script>
 <script>
 let app=new Vue({
	 el:'#app',
	 data:{
		 pics:true,
		 shopname:null,
		 list:[],
		 text:null,
		 tel:null,
		 time:null,
		 mid:null,
		 shop:{},
		 check:false,
		 pic:null
	 },
	 methods:{
		 upload(e){
				console.log(e.target.files,e.target.files[0].name,"name");
				this.pic = e.target.files[0].name;
				for(let item of e.target.files){
					console.log(item.type);
					if(!/image\/\w+/.test(item.type)){
						alert("只能选择图片");
					}
						var _this=this;
						
						let reader=new FileReader();
						reader.readAsDataURL(item);
						reader.addEventListener('load',function(){
							_this.list.push(this.result);
							_this.pics=false;
						});
				}
			},
			uptext(){
				let files = document.getElementById("photo").files;
				console.log(files,"files");
				if(this.shopname == null || this.shopname == "" || this.pic == null || this.pic == "" || this.tel == null || this.tel == "" || this.time == null || this.time == ""){
					showmsg("请补全信息.....","yellow");
					return;
				}
				if(this.check){
					$.ajaxFileUpload({
						url: "../../shop/createshop",
						secureuri: false,
						fileElementId: "photo",
						data: {sname:this.shopname,stel:this.tel,time:this.time},
						dataType: "json",
						success: function(rt, status) {
							if(rt.code == 500) {
								showmsg(rt.msg, "red");
								return;
							}
							
							if(rt.code == 200) {
								$("#myform")[0].reset();
								$("#showpic").html("");
								layui.table.reload("type_data");
								return;
							}
							showmsg("添加失败,请稍后重试...\n" + e, "red");
						}
					})
					/**axios.post("shop/createshop",qs.stringify({sname:this.shopname,stel:this.tel,time:this.time})).then(rt=>{
						if(rt.data.code == 511){ //未登录  NOTLOGIN
							showmsg("未登录.....","yellow", function(){location.href="login.html?setting.html"});
							return;
						}
						
						if(rt.data.code == 200 ){  //发送成功  SUCCESS
							showmsg("成功.....","green");
							return;
						}
						
						if(rt.data.code == 500){ //错误  ERROR
							showmsg("失败.....","red");
							return;
						}
					});**/
				}else{
					showmsg("店铺申请还没有通过...","yellow");
				}
			
			}
	 },
	created(){
			axios.post("member/checklogin",null).then(rt=>{
				if(rt.data.code == 200){
					this.userinfo = rt.data.data;
					this.mid = rt.data.mid;
					return;
				}
				if(rt.data.code == 511){
					showmsg(rt.data.message + ".....","yellow",function(){location.href="login.html?setting.html";})
				}
			})
			
			axios.post("shop/check",null).then(rt=>{
				if(rt.data.code == 600){ //没有资源  NOT_DATA
					showmsg("还没有提交商铺申请.....","yellow",function(){location.href="authenticate.html"});
				}
				if(rt.data.code == 200){
					this.shop = rt.data.data;
					this.status = rt.data.data.status;
					if(this.status == 1 || this.status == "1"){
						this.check = true;
					}
				}
			})
		}
 });
 $(document).ready(function(){
   //测试效果，程序对接如需变动重新编辑
   $(".switchNav li").click(function(){
     $(this).addClass("active").siblings().removeClass("active");
     });
   $("#chanpin").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入产品关键词或货号");
     });
   $("#shangjia").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入商家店铺名");
     });
   $("#zixun").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入关键词查找文章内容");
     });
   $("#wenku").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入关键词查找文库内容");
     });
   });
   
 function setImagePreviews(val1,val2){
	 console.log(val1,val2);
 }
 </script>
</body>
</html>
